<?php
session_set_cookie_params(1800 , '/', '.aaa.com'); 
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Passport example</title>
</head>
<body>
<?php if(!isset($_SESSION['username'])){?>
<form action="login.php" method="post" id="loginform">
<p>username:<input type="text" name="username" id="username" value="admin" /></p>
<p>password:<input type="password" name="password" id="password" value="123456" /></p>
<p><input type="submit" name="submit" value="Login"/></p>
</form>
<?php }else{?>
user:<?=$_SESSION['username']?> | <a href="logout.php">logout</a>
<?php }?>

</body>
</html>